/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tbltipoconceptos")
@NamedQueries({
    @NamedQuery(name = "Tbltipoconceptos.findAll", query = "SELECT t FROM Tbltipoconceptos t"),
    @NamedQuery(name = "Tbltipoconceptos.findByCodConcepto", query = "SELECT t FROM Tbltipoconceptos t WHERE t.codConcepto = :codConcepto"),
    @NamedQuery(name = "Tbltipoconceptos.findByNomConcepto", query = "SELECT t FROM Tbltipoconceptos t WHERE t.nomConcepto = :nomConcepto")})
public class Tbltipoconceptos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "cod_concepto")
    private String codConcepto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nom_concepto")
    private String nomConcepto;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "tbltipoconceptos")
    private Tblconceptos tblconceptos;
    @JoinColumn(name = "cod_compania", referencedColumnName = "cod_compania")
    @ManyToOne(optional = false)
    private Tblcompania codCompania;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tbltipoconceptos() {
    }

    public Tbltipoconceptos(String codConcepto) {
        this.codConcepto = codConcepto;
    }

    public Tbltipoconceptos(String codConcepto, String nomConcepto) {
        this.codConcepto = codConcepto;
        this.nomConcepto = nomConcepto;
    }

    public String getCodConcepto() {
        return codConcepto;
    }

    public void setCodConcepto(String codConcepto) {
        this.codConcepto = codConcepto;
    }

    public String getNomConcepto() {
        return nomConcepto;
    }

    public void setNomConcepto(String nomConcepto) {
        this.nomConcepto = nomConcepto;
    }

    public Tblconceptos getTblconceptos() {
        return tblconceptos;
    }

    public void setTblconceptos(Tblconceptos tblconceptos) {
        this.tblconceptos = tblconceptos;
    }

    public Tblcompania getCodCompania() {
        return codCompania;
    }

    public void setCodCompania(Tblcompania codCompania) {
        this.codCompania = codCompania;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codConcepto != null ? codConcepto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tbltipoconceptos)) {
            return false;
        }
        Tbltipoconceptos other = (Tbltipoconceptos) object;
        if ((this.codConcepto == null && other.codConcepto != null) || (this.codConcepto != null && !this.codConcepto.equals(other.codConcepto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + nomConcepto + "";
    }
    
}
